home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / BESSY1.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  938b  |  24 lines

  1. FUNCTION bessy1(x: real): real;
  2. VAR
  3.    xx,z: real;  y,ans,ans1,ans2: double;
  4. BEGIN
  5.    IF (x < 8.0) THEN BEGIN
  6.       y := sqr(x);
  7.       ans1 := x*(-0.4900604943e13+y*(0.1275274390e13
  8.          +y*(-0.5153438139e11+y*(0.7349264551e9
  9.          +y*(-0.4237922726e7+y*0.8511937935e4)))));
  10.       ans2 := 0.2499580570e14+y*(0.4244419664e12
  11.          +y*(0.3733650367e10+y*(0.2245904002e8
  12.          +y*(0.1020426050e6+y*(0.3549632885e3+y*1.0)))));
  13.       ans := (ans1/ans2)+0.636619772*(bessj1(x)*ln(x)-1.0/x);
  14.       bessy1 := sngl(ans) END
  15.    ELSE BEGIN
  16.       z := 8.0/x; y := sqr(z); xx := x-2.356194491;
  17.       ans1 := 1.0+y*(0.183105e-2+y*(-0.3516396496e-4
  18.          +y*(0.2457520174e-5+y*(-0.240337019e-6))));
  19.       ans2 := 0.04687499995+y*(-0.2002690873e-3
  20.          +y*(0.8449199096e-5+y*(-0.88228987e-6+y*0.105787412e-6)));
  21.       ans := sqrt(0.636619772/x)*(sin(xx)*ans1+z*cos(xx)*ans2);
  22.       bessy1 := sngl(ans) END
  23. END;
  24.